<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
        Schema::create('admins',function(Blueprint $table){
            $table->increments('id');                               //管理员标识
            $table->string('username')->unique();                   //管理员名字
            $table->string('password');                             //账号密码
            $table->string('login_ip')->nullable();                 //最后登录ip
            $table->timestamp('login_time');                        //最后登录时间
            $table->unsignedInteger('login_count')->default(0);     //登录次数
            $table->rememberToken();
            $table->softDeletes();
            $table->timestamps();
        });
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('admins');
	}

}
